package com.ant.backstage.facade.enums;

import org.apache.commons.lang3.StringUtils;

public enum  VerificationTypeEnum implements BaseEnum{


    // 验证码类型
    VERIFICATION_MAIL("mail","邮箱验证"),
    VERIFICATION_PHONE("phone","手机号验证"),
    VERIFICATION_RANDOM("verifcation","随机验证"),
            ;

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    VerificationTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static VerificationTypeEnum getByCode(String code) {
        if (StringUtils.isNotBlank(code)) {
            for (VerificationTypeEnum e : values()) {
                if (e.code.equals(code)) {
                    return e;
                }
            }
        }
        return null;
    }


}
